Skip to content

Conversation

@jmank88
Copy link
Contributor

@jmank88 jmank88 commented Jan 23, 2026

==================
WARNING: DATA RACE
Write at 0x00c001f8a8d0 by goroutine 973:
  runtime.closechan()
      /opt/hostedtoolcache/go/1.25.5/x64/src/runtime/chan.go:414 +0x0
  github.com/smartcontractkit/chainlink-common/pkg/capabilities/registry.(*triggerRegistrationManager).unregister()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/capabilities/registry/base.go:253 +0x189
  github.com/smartcontractkit/chainlink-common/pkg/capabilities/registry.(*atomicTriggerCapability).UnregisterTrigger()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/capabilities/registry/base.go:400 +0x277
  github.com/smartcontractkit/chainlink/v2/core/services/workflows.(*Engine).deregisterTrigger()
      /home/runner/_work/chainlink/chainlink/core/services/workflows/engine.go:1095 +0x5ab
  github.com/smartcontractkit/chainlink/v2/core/services/workflows.(*Engine).Close.func1()
      /home/runner/_work/chainlink/chainlink/core/services/workflows/engine.go:1227 +0x2c4
  github.com/smartcontractkit/chainlink-common/pkg/services.(*StateMachine).StopOnce()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/services/state.go:132 +0xf4
  github.com/smartcontractkit/chainlink/v2/core/services/workflows.(*Engine).Close()
      /home/runner/_work/chainlink/chainlink/core/services/workflows/engine.go:1218 +0x6c
  github.com/smartcontractkit/chainlink-common/pkg/services/servicetest.Run[go.shape.*uint8].func1()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/services/servicetest/run.go:33 +0x74
  testing.(*common).Cleanup.func1()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1308 +0x168
  testing.(*common).runCleanup()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1572 +0x225
  testing.tRunner.func2()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1928 +0x4c
  runtime.deferreturn()
      /opt/hostedtoolcache/go/1.25.5/x64/src/runtime/panic.go:589 +0x5d
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1997 +0x44

Previous read at 0x00c001f8a8d0 by goroutine 5936:
  runtime.chansend()
      /opt/hostedtoolcache/go/1.25.5/x64/src/runtime/chan.go:176 +0x0
  github.com/smartcontractkit/chainlink-common/pkg/capabilities/registry.forwardTriggerResponses()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/capabilities/registry/base.go:317 +0x207
  github.com/smartcontractkit/chainlink-common/pkg/capabilities/registry.(*triggerRegistrationManager).upsertRegistration.gowrap1()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/capabilities/registry/base.go:283 +0x5d

Goroutine 973 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1997 +0x9d2
  testing.runTests.func1()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:2477 +0x85
  testing.tRunner()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:1934 +0x21c
  testing.runTests()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:2475 +0x96c
  testing.(*M).Run()
      /opt/hostedtoolcache/go/1.25.5/x64/src/testing/testing.go:2337 +0xed4
  main.main()
      _testmain.go:99 +0x164

Goroutine 5936 (running) created at:
  github.com/smartcontractkit/chainlink-common/pkg/capabilities/registry.(*triggerRegistrationManager).upsertRegistration()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/capabilities/registry/base.go:283 +0x504
  github.com/smartcontractkit/chainlink-common/pkg/capabilities/registry.(*triggerRegistrationManager).register()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/capabilities/registry/base.go:239 +0x104
  github.com/smartcontractkit/chainlink-common/pkg/capabilities/registry.(*atomicTriggerCapability).RegisterTrigger()
      /home/runner/go/pkg/mod/github.com/smartcontractkit/chainlink-common@v0.9.6-0.20260120124124-33cb8e0bd2c5/pkg/capabilities/registry/base.go:391 +0x2d7
  github.com/smartcontractkit/chainlink/v2/core/services/workflows.(*Engine).registerTrigger()
      /home/runner/_work/chainlink/chainlink/core/services/workflows/engine.go:434 +0x5a7
  github.com/smartcontractkit/chainlink/v2/core/services/workflows.(*Engine).init()
      /home/runner/_work/chainlink/chainlink/core/services/workflows/engine.go:388 +0x5f7
  github.com/smartcontractkit/chainlink/v2/core/services/workflows.(*Engine).launch.gowrap2()
      /home/runner/_work/chainlink/chainlink/core/services/workflows/engine.go:188 +0x4f
==================

@jmank88 jmank88 requested a review from a team as a code owner January 23, 2026 13:58
@jmank88 jmank88 requested a review from bolekk January 23, 2026 13:58
@github-actions
Copy link

👋 jmank88, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link

github-actions bot commented Jan 23, 2026

✅ API Diff Results - No breaking changes


📄 View full apidiff report

@jmank88 jmank88 enabled auto-merge January 23, 2026 14:00
@jmank88 jmank88 requested a review from pavel-raykov January 23, 2026 14:04
pavel-raykov
pavel-raykov previously approved these changes Jan 23, 2026
@jmank88 jmank88 marked this pull request as draft January 23, 2026 15:56
auto-merge was automatically disabled January 23, 2026 15:56

Pull request was converted to draft

@jmank88 jmank88 changed the title pkg/capabilities/registry: close chan from sender pkg/capabilities/registry: fix chan race Jan 23, 2026
bolekk
bolekk previously approved these changes Jan 23, 2026
@jmank88
Copy link
Contributor Author

jmank88 commented Jan 23, 2026

Simplified by removing that extra type.

@jmank88 jmank88 enabled auto-merge January 23, 2026 18:05
@jmank88 jmank88 added this pull request to the merge queue Jan 26, 2026
Merged via the queue into main with commit 1cd3adb Jan 26, 2026
35 of 36 checks passed
@jmank88 jmank88 deleted the cap-reg-base-race branch January 26, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants